package org.example.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author yangdc
 * @date 10/13/25 00:44
 */
@RestController
@RequestMapping
public class HelloController {
    private final DateTimeFormatter timeDtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    @GetMapping
    ResponseEntity<String> index() {
        String now =LocalDateTime.now().format(timeDtf);
        return ResponseEntity.ok("hello" + now);
    }
}
